package com.jeesite.modules.vehicle.entity;

import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 分类表Entity
 * @author T
 * @version 2023-12-11
 */
@Table(name="h_car_type", alias="a", label="分类表信息", columns={
		@Column(name="type_code", attrName="typeCode", label="节点编码", isPK=true),
		@Column(name="big_type", attrName="bigType", label="归属大类", comment="归属大类（0摩托车 1汽车）"),
		@Column(name="parent_code", attrName="parent.typeCode", label="父级编号", isParentCode=true),
		@Column(name="tree_name", attrName="treeName", label="节点名称", queryType=QueryType.LIKE, isTreeName=true),
		@Column(name="img_url", attrName="imgUrl", label="车型图片"),
		@Column(name="suggest_status", attrName="suggestStatus", label="是否推荐", comment = "1推荐，其他则不推荐"),
	}, orderBy="a.update_date desc"
)
public class CarTypeApi extends TreeEntity<CarTypeApi> {
	
	private static final long serialVersionUID = 1L;
	private String typeCode;	// 节点编码
	private String bigType;		// 归属大类（0摩托车 1汽车）
	private String treeName;	// 节点名称
	private Integer limitSize; // 条数
	private String imgUrl;
	private String suggestStatus;

	public CarTypeApi() {
		this(null);
	}
	
	public CarTypeApi(String id){
		super(id);
	}
	
	@Override
	public CarTypeApi getParent() {
		return parent;
	}

	@Override
	public void setParent(CarTypeApi parent) {
		this.parent = parent;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public String getSuggestStatus() {
		return suggestStatus;
	}

	public void setSuggestStatus(String suggestStatus) {
		this.suggestStatus = suggestStatus;
	}

	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}
	
	@NotBlank(message="归属大类不能为空")
	@Size(min=0, max=64, message="归属大类长度不能超过 64 个字符")
	public String getBigType() {
		return bigType;
	}

	public void setBigType(String bigType) {
		this.bigType = bigType;
	}
	
	@NotBlank(message="节点名称不能为空")
	@Size(min=0, max=200, message="节点名称长度不能超过 200 个字符")
	public String getTreeName() {
		return treeName;
	}

	public void setTreeName(String treeName) {
		this.treeName = treeName;
	}

	public Integer getLimitSize() {
		return limitSize;
	}

	public void setLimitSize(Integer limitSize) {
		this.limitSize = limitSize;
	}
}